﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Windows.Forms;

namespace WF_TheTourManagement.EntityClass
{
    public static class DataConnection
    {
        static SqlConnection connection;



        public static SqlConnection Connection()
        {
            string conString = "Data Source=.\\SQLEXPRESS;Initial Catalog=ToursManagement;Integrated Security=True";
            //string cmdString = "select * from Tours";

            try
            {
                connection = new SqlConnection(conString);
                connection.Open();

            }
            catch (Exception ex)
            {
                MessageBox.Show("Error - Unable to connect");
            }

            return connection;
        
        }

        public static void closeConnection()
        {
            connection.Close();
        }
    }
}
